// pages/index/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    navTab: ["周", "月", "年", "自定义"],
    currentSelectTab: "0"
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.setNavigationBarTitle({ title: "首页" })

    // 页面渲染完成 
    var cxt_arc = wx.createCanvasContext('canvasArc0');//创建并返回绘图上下文context对象。 
    cxt_arc.setLineWidth(5);
    cxt_arc.setStrokeStyle('#f0f0f0');
    cxt_arc.setLineCap('round')
    cxt_arc.beginPath();//开始一个新的路径 
    cxt_arc.arc(375/2 - 110, 50, 40, 0, 2 * Math.PI, false);//设置一个原点(106,106)，半径为100的圆的路径到当前路径 
    cxt_arc.stroke();//对当前路径进行描边 

    cxt_arc.setLineWidth(6);
    cxt_arc.setStrokeStyle('#dd5555');
    cxt_arc.setLineCap('round')
    cxt_arc.beginPath();//开始一个新的路径 
    cxt_arc.arc(375 / 2 - 110, 50, 40, -Math.PI * 1 / 2, Math.PI * 6 / 5, false);
    cxt_arc.stroke();//对当前路径进行描边 

    cxt_arc.draw();

    // 页面渲染完成 
    var cxt_arc = wx.createCanvasContext('canvasArc1');//创建并返回绘图上下文context对象。 
    cxt_arc.setLineWidth(5);
    cxt_arc.setStrokeStyle('#f0f0f0');
    cxt_arc.setLineCap('round')
    cxt_arc.beginPath();//开始一个新的路径 
    cxt_arc.arc(375 / 2 - 110, 50, 40, 0, 2 * Math.PI, false);//设置一个原点(106,106)，半径为100的圆的路径到当前路径 
    cxt_arc.stroke();//对当前路径进行描边 

    cxt_arc.setLineWidth(6);
    cxt_arc.setStrokeStyle('#3ea6ff');
    cxt_arc.setLineCap('round')
    cxt_arc.beginPath();//开始一个新的路径 
    cxt_arc.arc(375 / 2 - 110, 50, 40, -Math.PI * 1 / 2, Math.PI * 6 / 5, false);
    cxt_arc.stroke();//对当前路径进行描边 

    cxt_arc.draw();
  },

  switchTab: function (e) {
    this.setData({
      currentSelectTab: e.target.dataset.selectTab
    });
    // debugger
  }
})